package com.example.fangwei.utilsapp.rounddiskview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.SeekBar;

import com.example.fangwei.utilsapp.R;
import com.fangwei.utilsLibrary.customerview.roundcornerprogressbar.CornerProgressView;
import com.fangwei.utilsLibrary.customerview.rounddiskview.RoundDiskView;

/**
 * 展示圆弧形的仪表盘界面
 * 展示带圆角的进度条 颜色为渐变
 */
public class RoundDiskViewActivity extends AppCompatActivity {

    private RoundDiskView roundDiskView;
    private SeekBar seekBar;
    private CornerProgressView progressView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_round_disk_view);
        initView();
    }

    private void initView() {
        roundDiskView = ((RoundDiskView) findViewById(R.id.roundDiskView));
        progressView = ((CornerProgressView) findViewById(R.id.pView));
        progressView.setMaxCount(100);
        progressView.setCurrentCount(50);

        seekBar = ((SeekBar) findViewById(R.id.seekbar));
        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                roundDiskView.setCurrentCount(progress);
                progressView.setCurrentCount(progress);
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });
    }


}
